<template>
  <div class="">
    <ele-pro-table
      style="width: 100%"
      :datasource="datasource"
      :pagination="false"
      :columns="columns"
      :toolbar="false"
    />
  </div>
</template>

<script setup>
const props = defineProps({
  orderId: Number,
})

/** 表格列配置 */
const columns = ref([
  {
    type: 'index',
    label: '序',
    width: 50,
    align: 'left',
    fixed: 'left',
  },
  {
    prop: 'content',
    label: '事件描述',
    align: 'left',
    minWidth: 300,
    showOverflowTooltip: true,
  },
  {
    prop: 'type_name',
    label: '事件类型',
    align: 'center',
  },
  {
    prop: 'create_user_name',
    label: '操作人',
    align: 'center',
  },
  {
    prop: 'create_time',
    label: '操作时间',
    formatter: (row) => {
      return utils.formatDate(row.create_time)
    },
    align: 'center',
  },
])

/** 表格数据源 */
function datasource({ page, limit, where, orders }) {
  return utils.get('/outbound/logList', { ...where, ...orders, outbound_id: props.orderId, page, limit })
}
</script>

<style lang="scss" scoped>

</style>
